<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<div class="pad-lr-10">
<div class="explain-col">
		<strong>温馨提醒</strong><br>
		不建议删除 ,<font color="red">当删除成功时，会导致数据混乱。</font>
	</div>
	<div class="bk10"></div>
<form action="<?php echo U('manage'); ?>" method="post">
<table width="100%" cellspacing="0" class="search-form">
    <tbody>
		<tr>
		<td>
		<div class="explain-col">				
				奖励时间：
				<?php echo $form::date('start_time', $start_time)?>-
				<?php echo $form::date('end_time', $end_time)?>	
				会员id:
				<input name="uid" type="text" value="<?php if(isset($_GET['id'])) {echo $_GET['id'];}?>" class="input-text" />
				<input type="submit" name="search" class="button" value="<?php echo L('search')?>" />
	</div>
		</td>
		</tr>
    </tbody>
</table>
</form>

<form name="myform" action="<?php echo U('delete');?>" method="post" onsubmit="checkuid();return false;">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th  align="left" width="20"><input type="checkbox" value="" id="check_box" onclick="selectall('userid[]');"></th>
			<th align="left">用户id</th>
			<th align="left">用户名</th>
			<th align="left">奖励金额</th>
			<th align="left">变化原因</th>
			<th align="left">奖励时间</th>
				
			<th align="left"><?php echo L('operation')?></th>
		</tr>
	</thead>
<tbody>
<?php
	if(is_array($rewardlist)){
	foreach($rewardlist as $k=>$v) {
		foreach ($user as $s){
			if ($v['userid'] == $s['userid']){
?>
    <tr>
		<td align="left"><input type="checkbox" value="<?php echo $v['id']?>" name="ids[]"></td>
		
		<td align="left"><?php echo $v['userid']?></td>
		<td align="left"><?php echo $s['nickname']?></td>
		<td align="left"><?php echo exchange_money($v['change'])?>元</td>
		<td align="left"><?php echo $v['reason']?></td>
		<td align="left"><?php echo date('Y-m-d H:i:s',$v['posttime']);?></td>
		<td align="left">
     <a href="javascript:deletes('<?php echo $v['id']; ?>')">删除</a>		</td>
    </tr>
    
<?php
			}
		}
	}
}
?>

</tbody>
</table>
<div id="pages"><?php echo $pages?></div>
<label for="check_box"><?php echo L('select_all')?>/<?php echo L('cancel')?></label> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>" onclick="return confirm('<?php echo L('sure_delete')?>')"/>


</div>
</form>
</div>
<script type="text/javascript">

function deletes(id){
	  if(confirm("<?php echo L('affirm_delete')?>") == true){
	    window.location.href = "?m=Member&c=Reward&a=delete&id="+id;
	  }
	}

</script>
</body>
</html>